<?php 

require ('easyrest/Client.php');

//config                      
/* ---------------------------------------------------------------------------*/
                                                       
$client = new Client();
//$client->config->service('rpc');  version 1.0.1 rpc and rest switch.
$client->config->uri('http://localhost/easyrest/server.php');
$client->config->id('1');  //client id.
$client->config->secretkey('my secret keyword here');
$client->config->apikey('my api key');
$client->config->debug(false);    //return xml.

//call commands
/* ---------------------------------------------------------------------------*/

$client->call->post(array('post_var1'=>'value1', 'post_var2'=>'value2'));
$client->call->command('example.test1');
$client->call->params(array('1', 'i am a string param 2',true,'string blablabla <b>hghjvg</b>',false));


//call another command               
$client->call->get();                                                          
$client->call->command('example.test3');                           
$client->call->params(array());


//call another command               
$client->call->post();                                                          
$client->call->command('example.test4');                           
$client->call->params(array());

//run all commands
$response = $client->call->run();             

//result
/* ---------------------------------------------------------------------------*/                                    
header('Content-type: text/html;charset=UTF-8');
print_r($response);



?>
